package com.unlcn.ils.kas.async;

import java.util.concurrent.Future;

import com.unlcn.ils.kas.service.order.SharesOrderService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.AsyncResult;
import org.springframework.stereotype.Component;

@Component
public class AsyncOrder {
    @Autowired
    private SharesOrderService sharesOrderService;

    /**
     *
     * @param thread
     */
    @Async
    public Future<String> asyncGetOrder(int thread) {
        // 获取线程名称
        String pushThreadName = Thread.currentThread().getName();
        System.out.println("asyncGetOrder线程名:" + pushThreadName);
        sharesOrderService.getOrder2(thread);
        return new AsyncResult<String>("Done");
    }

}
